cc.Class({
    extends: cc.Component,

    properties: {
        player: cc.Node
    },

    update(dt) {
        this.node.x = this.player.x;
        this.node.y = this.player.y;
        let _w = (23 * 45 - 640) / 2;
        let _h = (39 * 45 - 1136) / 2;
        if (this.node.x > _h) {
            this.node.x = _h;
        } else if (this.node.x < -_h) {
            this.node.x = -_h;
        }

        if (this.node.y > _w) {
            this.node.y = _w;
        } else if (this.node.y < -_w) {
            this.node.y = -_w;
        }
    },
});
